package com.mall.service;

import com.mall.mapper.AdminMapper;
import com.mall.mapper.BusinessMapper;
import com.mall.pojo.Business;
import com.mall.pojo.Commodity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusinessServiceImpl  implements BusinessService{

    @Autowired
    private BusinessMapper mapper;

    @Override
    public Boolean insertBusiness(Business business) {
        return mapper.insertBusiness(business);
    }

    @Override
    public Business login(String identityCard, String pwd) {
        return mapper.login(identityCard,pwd);
    }

    @Override
    public Business loginByPhone(String identityCard, String pwd) {
        return mapper.loginByPhone(identityCard,pwd);
    }

    @Override
    public List<Commodity> showCommodity(String name, Integer pageSize, Integer offset) {
        return mapper.showCommodity(name,pageSize,offset);
    }

    @Override
    public Integer showCommodityCount(String name) {
        return mapper.showCommodityCount(name);
    }

    @Override
    public Boolean addCommodity(Commodity commodity) {
        return mapper.addCommodity(commodity);
    }
}
